{% extends "base.html" %}

{% block content %}


{% if user.is_authenticated %}
<div>
    <div class="inputInfoBox">
        <h2>个人信息 <a href="/change_info/">修改</a></h2>
        <table>
            <tr>
                <th>用户名</th>
                <td class="info">{{user.username}}</td>
            </tr>
            <tr>
                <th>邮箱</th>
                <td class="info">{{user.email}}</td>
            </tr>
            <tr>
                <th>性别</th>
                <td class="info">{{sex}}</td>
            </tr>
            <tr>
                <th>地址</th>
                <td class="info">{{address}}</td>
            </tr>
        </table>
        <br>
    </div>
    <br>
    <div class="inputInfoBox">
        <h2>订单列表</h2>
        <table>
            <tr>
                <th>订单号</th>
                <th>交易时间</th>
                <th>商品名</th>
                <th>操作</th>
            </tr>
            {% for items in orders %}
            <tr>
                <td width="60px">{{items.id}}</td>
                <td width="80px">{{items.created_time}}</td>
                <td width="80px"><a href="/good/{{items.good.id}}">{{items.good}}</a></td>
                <td>
                    {{items.comment}}
                    <a href="/comment/{{items.id}}/">评价</a>
                    <a href="/delete_order/{{items.id}}/">删除</a>
                </td>
            </tr>
            {% endfor %}
        </table>
        <br>
    </div>
    {% else %}

    {% endif %}

    {% endblock %}